package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.SpecificArea;
import cn.wolfcode.trip.base.mapper.SpecificAreaMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.ISpecificAreaService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpecificAreaServiceImpl implements ISpecificAreaService {
    @Autowired
    private SpecificAreaMapper specificAreaMapper;
    //新增修改
    @Override
    public void update(SpecificArea specificArea) {
        if (specificArea.getStrategyId() != null){
            specificAreaMapper.update(specificArea);
        }
    }
    //查所有
    @Override
    public PageInfo<SpecificArea> selectAll(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<SpecificArea> list = specificAreaMapper.selectAll(qo);
        return new PageInfo<>(list);
    }
}
